<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
	<head>
		<title><?php echo ($system_name); ?></title>
		<meta charset="UTF-8">
		<meta name="keywords" content="">
		<meta name="description" content="">
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<!-- intoHead  -->
		<link rel="stylesheet" type="text/css" href="<?php echo C('BOOTSTRAP');?>css/bootstrap.min.css?v=<?php echo C('VERSION');?>" />
		<link rel="stylesheet" type="text/css" href="<?php echo C('HOME_CSS');?>console.css?v=<?php echo C('VERSION');?>" />
		<link rel="stylesheet" type="text/css" href="<?php echo C('HOME_CSS');?>main.min.css" />
		<script type="text/javascript" src="<?php echo C('HOME_JS');?>jquery-2.0.3.min.js?v=<?php echo C('VERSION');?>"></script>
		<script type="text/javascript" src="<?php echo C('HOME_JS');?>index.js?v=<?php echo C('VERSION');?>"></script>
		<script language="JavaScript" src="<?php echo C('LAYERUI');?>layui.js?v=<?php echo C('VERSION');?>"></script>
		<script language="JavaScript" src="<?php echo C('HOME_JS');?>function.js?v=<?php echo C('VERSION');?>"></script>
		<script>
		layui.use(['layer','form'], function(){
			var layer=layui.layer;
			var form =layui.form();
		});
		</script>
		<link rel="stylesheet" type="text/css" href="<?php echo C('HOME_CSS');?>iframe.css?v=<?php echo C('VERSION');?>" />
		<script>
			var city_url = "<?php echo C('HOME_JS');?>city.min.js";
		</script>
		<script type="text/javascript" src="<?php echo C('HOME_JS');?>jquery.cityselect.js"></script>
		<script type="text/javascript" src="<?php echo C('UPLOAD');?>jquery.form.js"></script>

	</head>
<style type="text/css">
	table{width:100%;}
	table td,table th{padding:6px 0px 6px 6px;background:#FFFFFF;}
	table th{text-align:center;line-height:30px;margin:5px;border-bottom:10px solid #f5f5f5;border-right:1px solid #DEDEDE;color:#3e3e3e;}
	table td{text-align:center;border-bottom:2px solid #DEDEDE;line-height:25px;}
	.spacess{color:#ccc;float:right;border-right:1px solid #DEDEDE;height:35px;}
	.opration{text-align: left !important;padding-left:30px;border-right:1px solid #DEDEDE;}
</style>
<body class="iframe-body">

	<div class="container">
		<input type="hidden" id="userid" value="<?php echo ($user["id"]); ?>">
		<div class="form-group" style="margin-top:10px">
		    <label class="col-sm-2 control-label" style="line-height:70px;"><?php echo (L("USER_PIC")); ?></label>
		    <div class="upload col-sm-10">
              <div class="upload-img-box" >
              <?php if(empty($user["head_pic"])): ?><img width="70px" height="70px" src="<?php echo C('HOME_IMAGE');?>add_img.jpg"/>
              <?php else: ?>
              	  <img width="70px" height="70px" src="<?php echo ($user["head_pic"]); ?>"/><?php endif; ?>
              </div>
              <input type="file" id="pic" src="<?php echo ($user["head_pic"]); ?>" name="pic" title="<?php echo (L("_UPDATE_IMG")); ?>">
           	</div>
		  </div>
		  <div class="form-group">
		    <label class="col-sm-2 control-label"><?php echo (L("USER_NAME")); ?></label>
		    <div class="col-sm-10">
		      <input type="text" class="form-control" id="name" placeholder="<?php echo (L("USER_NAME")); ?>" value="<?php echo ($user["name"]); ?>">
		    </div>
		  </div>
		  <div class="form-group">
		    <label class="col-sm-2 control-label"><?php echo (L("USER_NICKNAME")); ?></label>
		    <div class="col-sm-10">
		      <input type="text" class="form-control" id="nickname" placeholder="<?php echo (L("USER_NAME")); ?>" value="<?php echo ($user["nickname"]); ?>">
		    </div>
		  </div>
		  <div class="form-group">
		    <label class="col-sm-2 control-label"><?php echo (L("USER_PHONE")); ?></label>
		    <div class="col-sm-10">
		      <input type="text" class="form-control" id="phone" placeholder="<?php echo (L("USER_NAME")); ?>" value="<?php echo ($user["phone"]); ?>">
		    </div>
		  </div>
		  <div class="form-group">
		    <label class="col-sm-2 control-label"><?php echo (L("USER_EMAIL")); ?></label>
		    <div class="col-sm-10">
		      <input type="text" class="form-control" id="email" placeholder="<?php echo (L("USER_EMAIL")); ?>" value="<?php echo ($user["email"]); ?>">
		    </div>
		  </div>
		  <div class="form-group">
		    <label class="col-sm-2 control-label"><?php echo (L("USER_SEX")); ?></label>
		    <div class="col-sm-10">
		      <input type="radio" name="sex" id="nan" value="1" <?php if(($user["sex"]) == "1"): ?>checked<?php endif; ?>><label for="nan">&nbsp;<?php echo (L("USER_MAN")); ?></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="sex" id="nv" value="2" <?php if(($user["sex"]) == "2"): ?>checked<?php endif; ?>><label for="nv">&nbsp;<?php echo (L("USER_WOMAN")); ?></label>
		    </div>
		  </div>
		  <div class="form-group">
		    <label class="col-sm-2 control-label"><?php echo (L("_PASS")); ?></label>
		    <div class="col-sm-10">
		      <input type="text" class="form-control" id="password" placeholder="<?php echo (L("_PASS")); ?>" value="<?php echo ($user["password"]); ?>">
		    </div>
		  </div>

		  <div class="form-group">
		    <div class="col-sm-offset-2 col-sm-10">
		      <button style="background-color: #337ab7" class="btn btn-primary submit"><?php echo (L("_SAVE")); ?></button>
		    </div>
		  </div>
	</div>
	<script>
		var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
		var upload_url = "<?php echo U('Ajax/upload_user_img');?>";
		upload_a_img(upload_url);
		$('.submit').click(function(){
			var id=$('#userid').val();
			var pic = $('#pic').attr('src');
			var name = $('#name').val();
			var nickname=$('#nickname').val();
			var phone = $('#phone').val();
			var email = $('#email').val();
			var sex  = $("input[name='sex']:checked").val();
			var pass = $('#password').val();

			var data = {id:id,pic:pic,name:name,nickname:nickname,pass:pass,phone:phone,email:email,sex:sex};
			var url = "<?php echo U('Yhgl/edit');?>";
			$.post(url,data,function(res){
				if(res.code==1){
					layer.msg(res.msg,{time:2000},function(){
						parent.layer.close(index);
					})
				}else{
					layer.msg(res.msg,{time:2000},function(){
						parent.layer.close(index);
					})
				}
			})
		})
	</script>
		<!-- <div class="aliyun-console-sidebar-tooltip right fade in" title="" content="云服务器ECS&nbsp;" style="top: 120px; left: 50px; display: block;">
			<div class="tooltip-arrow"></div>
			<div class="tooltip-inner ng-binding">云服务器ECS&nbsp;</div>
		</div> -->
	</body>
</html>